<template>
      <div id="index">
        <el-container>
          <el-header>
            学生管理系统
            <el-dropdown>
  <span class="el-dropdown-link">
     个人信息<i class="el-icon-arrow-down el-icon--right"></i>
  </span>
              <el-dropdown-menu v-slot="dropdown">
                <el-dropdown-item>注销</el-dropdown-item>
                <el-dropdown-item>修改密码</el-dropdown-item>
                <el-dropdown-item>修改个人信息</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </el-header>
          <el-container>
            <el-aside width="200px">
              <el-col>
                <el-menu router
                    default-active="2"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose">
                  <el-submenu :index="item.path" v-for="(item,index) in this.$router.options.routes " :key="index">
                    <template slot="title">
                       <span>{{item.name}}</span>
                    </template>
                    <el-menu-item-group>
                      <el-menu-item :index="children.path" v-for="(children,index) in item.children" :key="index">{{children.name}}</el-menu-item>
                    </el-menu-item-group>
                  </el-submenu>
                </el-menu>
              </el-col>
            </el-aside>
            <el-main>Main
              <router-view/>
            </el-main>
          </el-container>
        </el-container>
      </div>
</template>

<script>
export default {
  name: "Index",
  data(){
    return {
      msg: '赵亚达'
    }
  },
  methods:{
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }

}
</script>

<style scoped>
.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
